dsh-guardian: DSH Task Protection Plugin

dsh-guardian is a task protection plugin for DeepSeek Harness (DSH), designed to address issues such as incomplete plugin declarations, task loops, excessive recursion, and session interruption upon restart. The core strategy of this plugin is "detection and guidance"; it never directly terminates a task but guides the Agent to adjust its direction by injecting user/message prompts and logs events. Its main functions include: 1. **Plugin pre-check:** Performs static code analysis to verify the consistency between service declarations and usage, offering fix recommendations. 2. **Loop detection:** Monitors the frequency of repeated calls to the same tool, triggering a prompt if the limit is exceeded. 3. **Recursion protection:** Limits the nesting depth of child agents to prevent infinite recursion. 4. **Interrupt awareness:** Provides a status interface that returns the running status, nesting depth, and a safe restart flag (safeToRestart), assisting in determining whether to restart when interrupted.

Read More